/*---------------------------------------------------------------------------------

	Basic template code for starting a DS app

---------------------------------------------------------------------------------*/
#include <nds.h>
#include "Dungeon.h"

//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------
	//set up video mode and vram mapping
	videoSetMode(MODE_0_2D);
	vramSetBankA(VRAM_A_MAIN_BG);

	//create 3 backgrounds to hold our layers
	int layer0 = bgInit(2, BgType_Text8bpp, BgSize_T_256x256, 0, 1);
	int layer1 = bgInit(1, BgType_Text8bpp, BgSize_T_256x256, 2, 1);
	int layer2 = bgInit(0, BgType_Text8bpp, BgSize_T_256x256, 4, 1);
	
	//load the shared tiles and palette
	dmaCopy(DungeonSharedTiles, bgGetGfxPtr(layer0), DungeonSharedTilesLen);
	dmaCopy(DungeonSharedPal, BG_PALETTE, DungeonSharedPalLen);

	//load the maps for the 3 layers
	dmaCopy(FloorMap, bgGetMapPtr(layer0), FloorMapLen);
	dmaCopy(WallsMap, bgGetMapPtr(layer1), WallsMapLen);
	dmaCopy(HangingThingsMap, bgGetMapPtr(layer2), HangingThingsMapLen);


	
	while(1) {
		swiWaitForVBlank();
	}

}
